//
//  MYGoodDetailView.m
//  MiYuan_iOS
//
//  Created by zhangyongbing on 2018/5/14.
//  Copyright © 2018年 zhangyongbing. All rights reserved.
//

#import "MYGoodDetailView.h"

@implementation MYGoodDetailView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initSelfViews];
    }
    return self;
}

- (void)initSelfViews
{
    CGFloat imgh = self.frame.size.width*95/130;
    _imgIcon = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, imgh)];
    [_imgIcon setBackgroundColor:[UIColor clearColor]];
    [self addSubview:_imgIcon];
    
    _labTitle = [[UILabel alloc] initWithFrame:CGRectMake(2, imgh +5, self.frame.size.width-4, 30)];
    [_labTitle setFont:[UIFont systemFontOfSize:12]];
    _labTitle.minimumScaleFactor = 0.5;
    _labTitle.numberOfLines = 2;
    [_labTitle setBackgroundColor:[UIColor clearColor]];
    [_labTitle setTextColor:[UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:1]];
    [self addSubview:_labTitle];
    
    _labStock = [[UILabel alloc] initWithFrame:CGRectMake(2, imgh +34, (self.frame.size.width-4)/2, 15)];
    [_labStock setFont:[UIFont systemFontOfSize:11]];
    _labStock.minimumScaleFactor = 0.5;
    [_labStock setBackgroundColor:[UIColor clearColor]];
    [_labStock setTextColor:[UIColor colorWithRed:102/255 green:102/255 blue:102/255 alpha:1]];
    [self addSubview:_labStock];
    
    _labRestocking = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width/2, imgh +34, (self.frame.size.width-4)/2, 15)];
    [_labRestocking setFont:[UIFont systemFontOfSize:11]];
    _labRestocking.minimumScaleFactor = 0.5;
    [_labRestocking setBackgroundColor:[UIColor clearColor]];
    _labRestocking.textAlignment = NSTextAlignmentRight;
    [_labRestocking setTextColor:[UIColor colorWithRed:102/255 green:102/255 blue:102/255 alpha:1]];
    [self addSubview:_labRestocking];
    
}


@end
